@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(45deg, #FF6B9D, #FFE66D, #95E1D3, #A8E6CF);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #F8F8F8;
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 8px 8px 0 #000;
}

.header {
    background: #4A90E2;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #333;
}

.title {
    color: white;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000;
}

.controls {
    display: flex;
    gap: 12px;
}

.btn {
    background: #FF6B6B;
    color: white;
    border: 2px solid #333;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 2px 2px 0 #000;
    transition: transform 0.1s;
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #000;
}

.btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
}

.main-content {
    display: flex;
    background: #E8E8E8;
}

.toolbar {
    width: 200px;
    background: #D0D0D0;
    border-right: 4px solid #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tool-section h3,
.color-section h3,
.brush-section h3 {
    font-size: 10px;
    margin-bottom: 12px;
    color: #333;
}

.tool {
    background: #A8A8A8;
    border: 2px solid #333;
    padding: 12px;
    font-family: inherit;
    font-size: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    transition: all 0.1s;
}

.tool.active {
    background: #FFD93D;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 #000;
}

.tool:hover:not(.active) {
    background: #B8B8B8;
}

.tool-icon {
    width: 16px;
    height: 16px;
    border: 1px solid #333;
}

.brush-icon {
    background: #8B4513;
    border-radius: 50% 50% 50% 0;
}

.eraser-icon {
    background: #FFB6C1;
    border-radius: 2px;
}

.fill-icon {
    background: linear-gradient(45deg, #FF0000, #00FF00, #0000FF, #FFFF00);
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.color {
    width: 32px;
    height: 32px;
    border: 2px solid #333;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.1s;
}

.color.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #FFD93D;
}

.color:hover:not(.active) {
    transform: scale(1.05);
}

.brush-sizes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brush-size {
    background: #A8A8A8;
    border: 2px solid #333;
    padding: 8px;
    font-family: inherit;
    font-size: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
}

.brush-size.active {
    background: #FFD93D;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 #000;
}

.brush-size:hover:not(.active) {
    background: #B8B8B8;
}

.canvas-container {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#paintCanvas {
    border: 4px solid #333;
    background: white;
    cursor: crosshair;
    image-rendering: pixelated;
    border-radius: 4px;
    box-shadow: 4px 4px 0 #000;
    width: 640px;
    height: 480px;
}

.watermark {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 1000;
}

.resolution-640 {
    width: 640px;
    height: 480px;
    overflow: hidden;
    margin: 0 auto;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.resolution-640 .game-container {
    transform: scale(0.8);
    transform-origin: top left;
    width: 125%;
    height: 125%;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .toolbar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 16px;
    }
    
    .tool-section,
    .color-section,
    .brush-section {
        min-width: 150px;
    }
    
    #paintCanvas {
        width: 100%;
        height: auto;
    }
}